/**      
 * @file		checkFailure.cpp
 * @description		This utilizes, fail, the member function in ifstream
 *			This determines whether a file was successfully opened
 *			or not.
 * @course		CSCI 123 Section 00000
 * @assignment 
 * @date		mm/dd/yyyy
 * @author		Brad Rippe (00000000) brippe@fullcoll.edu
 * @version		1.0
 */
#include <fstream>		// include for ifstreams and ofstreams
#include <cstdlib>		// c standard library - used for exit
#include <iostream>
#include <string>		// used for strings
using namespace std;

/**
 * @return zero if the application executes successfully
 */
int main() {

	ifstream inFile;
	inFile.open("nofileexists.txt");
	if(inFile.fail()) {
		cout << "Couldn't open the file!\n";
		exit(1);	// returns an unsuccessful status code to the OS
	}
	
	// simply output the contents of the file
	string content;
	while(inFile >> content) {
		cout << content;
	}

	inFile.close();
	return 0;
}

